import request from '@/utils/request'
// 获取组织架构数据
export const reqGetDepartments = () => {
  return request({
    method: 'get',
    url: '/company/department'
  })
}
// 根据id删除部门
export const reqDelDepartments = (id) => {
  return request({
    method: 'delete',
    url: `/company/department/${id}`
  })
}
// 添加部门
export const reqAddDepartment = (data) => {
  return request({
    method: 'post',
    url: '/company/department',
    data
  })
}
// 获取部门详情
export function reqGetDepartDetail(id) {
  return request({
    url: `/company/department/${id}`
  })
}
// 根据id修改部门详情，form中需要有id
export function reqUpdateDepartment(data) {
  return request({
    method: 'put',
    url: `/company/department/${data.id}`,
    data: data
  })
}
